#!/usr/bin/env python

# Copyright 2012 Colin McDonough, Troy Velius

import roslib; roslib.load_manifest('pr2_hri')
import rospy
from std_msgs.msg import String
import actionlib
import pr2_hri.msg

class ExampleCameraTrack(object):

  def __init__(self, name):
    self.client = actionlib.SimpleActionClient('HriActionServer', pr2_hri.msg.HriAction)
    self.client.wait_for_server()

    while 1:
      goal_raise = pr2_hri.msg.HriGoal
      goal_raise.goalString = String('track_eye')
      self.client.send_goal(goal_raise)

      self.client.wait_for_result()

      result_raise = self.client.get_result()

      rospy.loginfo(result_raise.resultString.data)


if __name__ == '__main__':
  rospy.init_node('ExampleCameraTrack')
  hriDebug = rospy.Publisher('hriDebug', String)
  hriDebug.publish(String(rospy.get_name()))
  ExampleCameraTrack(rospy.get_name())
  rospy.spin()
